package com.qcu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * @TableName report
 */
@TableName(value ="report")
/**
 * 报告类
 * 该类映射到数据库中的"report"表，实现了序列化接口，以支持对象的序列化和反序列化
 */
public class Report implements Serializable {
    /**
     * 报告的唯一标识符
     * 使用数据库的自定义标识符生成策略进行赋值
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 居民身份证
     * 表示报告关联的居民，外键字段
     */
    private String inhabitantId;

    /**
     * 体温
     * 存储报告中的体温测量值
     */
    private BigDecimal temperature;

    /**
     * 心率
     *
     */
    private Integer frequency;

    /**
     * 创建时间
     * 记录报告创建的时间戳
     */
    private Date createdAt;

    /**
     * 更新时间
     * 记录报告最后一次更新的时间戳
     */
    private Date updatedAt;

    /**
     * 用户标识符
     * 表示创建或负责该报告的用户，外键字段
     */
    private Integer userId;


    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public String getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 
     */
    public String getInhabitantId() {
        return inhabitantId;
    }

    /**
     * 
     */
    public void setInhabitantId(String inhabitantId) {
        this.inhabitantId = inhabitantId;
    }

    /**
     * 
     */
    public BigDecimal getTemperature() {
        return temperature;
    }

    /**
     * 
     */
    public void setTemperature(BigDecimal temperature) {
        this.temperature = temperature;
    }

    /**
     * 
     */
    public Integer getFrequency() {
        return frequency;
    }

    /**
     * 
     */
    public void setFrequency(Integer frequency) {
        this.frequency = frequency;
    }

    /**
     * 
     */
    public Date getCreatedAt() {
        return createdAt;
    }

    /**
     * 
     */
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    /**
     * 
     */
    public Date getUpdatedAt() {
        return updatedAt;
    }

    /**
     * 
     */
    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Report other = (Report) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getInhabitantId() == null ? other.getInhabitantId() == null : this.getInhabitantId().equals(other.getInhabitantId()))
            && (this.getTemperature() == null ? other.getTemperature() == null : this.getTemperature().equals(other.getTemperature()))
            && (this.getFrequency() == null ? other.getFrequency() == null : this.getFrequency().equals(other.getFrequency()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getInhabitantId() == null) ? 0 : getInhabitantId().hashCode());
        result = prime * result + ((getTemperature() == null) ? 0 : getTemperature().hashCode());
        result = prime * result + ((getFrequency() == null) ? 0 : getFrequency().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", inhabitantId=").append(inhabitantId);
        sb.append(", temperature=").append(temperature);
        sb.append(", frequency=").append(frequency);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}